//
//  KLineSQLite.h
//  Chart
//
//  Created by CaoJun on 13-11-6.
//
//

#ifndef __Chart__KLineSQLite__
#define __Chart__KLineSQLite__

#include "BaseSQLite.h"
#include "KLineData.h"

#include <vector>
#include <string>

namespace ytx
{
    class KLineSQLite : public BaseSQLite{
    private:
        static std::vector<KLineItem> transforDataKLineItem(DBResult & dbResult);
    public:
        KLineSQLite();
        virtual ~KLineSQLite();
        bool insertData(std::string tableName, std::vector<KLineItem> data);
        bool checkInRange(std::string tableName, YTXTime * outputLastTime, KLineData * kData, YTXTime time);
        bool getDataFromDB(std::string tableName,YTXTime time, std::vector<KLineItem> * kLineItems, const unsigned int count = 300);
        bool createKLineDataTableIfNotExit(const std::string tabName);
        bool vacuumDB();
    };
}

#endif /* defined(__Chart__KLineSQLite__) */
